<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
	<title>行业联谊-内推招聘</title>
	<link rel="icon" href="favicon.ico" type="image/ico">
	<meta name="keywords" content="审核">
	<meta name="author" content="yinqi">
	<link href="/css/bootstrap.min.css" rel="stylesheet">
	<link href="/css/materialdesignicons.min.css" rel="stylesheet">
	<link href="/css/style.min.css" rel="stylesheet">
	<link rel="stylesheet" href="/js/jconfirm/jquery-confirm.min.css">
</head>
<body>
<div class="row">
	<div class="col-lg-12">
		<div class="card">
			<div class="card-body">

				<form action="/job/updateJobById" method="post" class="row" >
					<input type="hidden" name="jobId" id="jobId" th:value="${job.jobId}">
					<div class="form-group col-md-4"></div>
					<div class="form-group col-md-3">
						<label for="jobName">职位名称</label>
						<input type="text" class="form-control" id="jobName" name="jobName" th:value="${job.jobName}" readonly/>
					</div>
					<div class="form-group col-md-5"></div>
					<div class="form-group col-md-12"></div>

					<div class="form-group col-md-4"></div>
					<div class="form-group col-md-3">
						<label for="jobDesc">职位描述</label>
						<textarea type="text" class="form-control" id="jobDesc" name="jobDesc" th:text="${job.jobDesc}" readonly></textarea>
					</div>
					<div class="form-group col-md-5"></div>
					<div class="form-group col-md-12"></div>

					<div class="form-group col-md-4"></div>
					<div class="form-group col-md-3">
						<label for="perCount">招聘人数</label>
						<input type="text" class="form-control" id="perCount" name="perCount" th:value="${job.perCount}" readonly>
					</div>
					<div class="form-group col-md-5"></div>
					<div class="form-group col-md-12"></div>

					<div class="form-group col-md-4"></div>
					<div class="form-group col-md-3">
						<label for="jobEmail">投递地址</label>
						<input type="text" class="form-control" id="jobEmail" name="jobEmail" th:value="${job.jobEmail}" readonly>
					</div>
					<div class="form-group col-md-5"></div>
					<div class="form-group col-md-12"></div>

					<div class="form-group col-md-4"></div>
					<div class="form-group col-md-3">
						<input type="hidden" name="userId"  id="userId" th:value="${job.userId}">
						<label for="PerName">发布人</label>
						<input type="text" class="form-control" id="PerName" name="PerName" th:value="${job.tbTou.name}" readonly/>
					</div>
					<div class="form-group col-md-5"></div>
					<div class="form-group col-md-12"></div>

					<div class="form-group col-md-4"></div>
					<div class="form-group col-md-3">
						<label for="jobTime">发布时间</label>
						<input type="text" class="form-control" id="jobTime" name="acCreateTime" th:value="${#temporals.format(job.jobTime,'yyyy-MM-dd HH:mm:ss')}" readonly/>
					</div>
					<div class="form-group col-md-5"></div>
					<div class="form-group col-md-12"></div>

					<div class="form-group col-md-4"></div>
					<div class="form-group col-md-3">
						<label>审核状态</label>
						<div class="clearfix">
							<label class="lyear-radio radio-inline radio-primary">
								<input type="radio" name="checkStatus" value="0" th:checked="${job.checkStatus==0}"><span>未审核</span>
							</label>
							<label class="lyear-radio radio-inline radio-primary">
								<input type="radio" name="checkStatus" value="1" th:checked="${job.checkStatus==1}"><span>审核通过</span>
							</label>
							<label class="lyear-radio radio-inline radio-primary">
								<input type="radio" name="checkStatus" value="2" th:checked="${job.checkStatus==2}"><span>审核不通过</span>
							</label>
						</div>
					</div>
					<div class="form-group col-md-5"></div>
					<div class="form-group col-md-12"></div>

					<div class="form-group col-md-4"></div>
					<div class="form-group col-md-3">
						<label for="checkOpinion">审核意见</label>
						<textarea type="text" class="form-control" id="checkOpinion" name="checkOpinion" th:text="${job.checkOpinion}"  required></textarea>
					</div>
					<div class="form-group col-md-5"></div>
					<div class="form-group col-md-12"></div>


					<div class="form-group col-md-4"></div>
					<div class="form-group col-md-3">

						<button type="button" onclick="subJob()" class="btn btn-primary ajax-post" target-form="add-form">确 定</button>
						<button type="button" class="btn btn-default" onclick="javascript:history.back(-1);return false;">返 回</button>
					</div>
				</form>

			</div>
		</div>
	</div>

</div>
<script type="text/javascript" src="/js/jquery.min.js"></script>
<script type="text/javascript" src="/js/bootstrap.min.js"></script>
<script type="text/javascript" src="/js/perfect-scrollbar.min.js"></script>
<script src="/js/bootstrap-notify.min.js"></script>
<script type="text/javascript" src="/js/lightyear.js"></script>
<script type="text/javascript" src="/js/main.min.js"></script>
<script type="text/javascript" src="/js/axios.min.js"></script>
<script src="/js/jconfirm/jquery-confirm.min.js"></script>
<script type="text/javascript">
    function subJob(){
        var jobId=$('#jobId').val();
        var checkStatus=$("input[name='checkStatus']:checked").val();
        var checkOpinion=$('#checkOpinion').val();
        var userId=$('#userId').val();
        lightyear.loading('show');
        axios.get('/job/updateJobById?jobId='+jobId+"&checkStatus="+checkStatus+"&checkOpinion="+checkOpinion+"&userId="+userId).then(function (response) {
            var data=response.data;
            console.log(data);
            if(data==1){
                $.alert({
                    title: '内推审核',
                    content: '审核成功，确认返回主页',
                    buttons: {
                        confirm: {
                            text: '确认',
                            btnClass: 'btn-primary',
                            action: function () {
                                location.href = "/job/getAllJob"
                            }
                        }
                    }
                });
            }else {
                $.confirm({
                    title: '内推审核',
                    content: '审核失败，检查审核信息',
                    type: 'red',
                    buttons: {
                        tryAgain: {
                            text: '确认',
                            btnClass: 'btn-red',
                        }
                    }
                });
            }
        })

        setTimeout(function() {
            lightyear.loading('hide');
            lightyear.notify('系统审核中，请等待~', 'success', 3000,'mdi mdi-emoticon-happy', 'top', 'center');
        }, 1e3)

    }

</script>
</body>
</html>